package com.ruoyi.common.core.domain.event;

import com.ruoyi.common.constant.QueueConstant;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 推送消息事件
 *
 * @author Fgxia LD 99
 */

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PushMessageEvent implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 推送来源
     */
    private String pushRef;

    /**
     * 推送目标
     * 格式:
     * 推送渠道:推送目标
     * 如
     * QueueConstant.PUSH_SMS_QUEUE:手机号
     */
    private Map<String, String> pushTo;

    /**
     * 推送内容
     */
    private String pushContent;

    /**
     * 推送时间
     */
    private Date pushTime;


    /**
     * 推送到所有的渠道
     *
     * @param pushToObj
     * @return
     */
    public static Map<String, String> pushAll(String pushToObj) {
        Map<String, String> pushTo = new HashMap<>();
        pushTo.put(QueueConstant.PUSH_SMS_QUEUE, pushToObj);
        return pushTo;
    }


}
